package com.ruoyi.tjbb.controller;

import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.tjbb.domain.SysTjbbLspzcxbb;
import com.ruoyi.tjbb.service.ISysTjbbLspzcxbbService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 历史拍照查询Controller
 * 
 * @author ruoyi
 * @date 2023-09-26
 */
@RestController
@RequestMapping("/tjbb/dmttj/lspzcxbb")
public class SysTjbbLspzcxbbController extends BaseController
{
    @Autowired
    private ISysTjbbLspzcxbbService sysTjbbLspzcxbbService;

    /**
     * 查询历史拍照查询列表
     */
    @PreAuthorize("@ss.hasPermi('tjbb/dmttj:lspzcxbb:list')")
    @GetMapping("/list")
    public TableDataInfo list(SysTjbbLspzcxbb sysTjbbLspzcxbb)
    {
        startPage();
        List<SysTjbbLspzcxbb> list = sysTjbbLspzcxbbService.selectSysTjbbLspzcxbbList(sysTjbbLspzcxbb);
        return getDataTable(list);
    }

    /**
     * 导出历史拍照查询列表
     */
    @PreAuthorize("@ss.hasPermi('tjbb/dmttj:lspzcxbb:export')")
    @Log(title = "历史拍照查询", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, SysTjbbLspzcxbb sysTjbbLspzcxbb)
    {
        List<SysTjbbLspzcxbb> list = sysTjbbLspzcxbbService.selectSysTjbbLspzcxbbList(sysTjbbLspzcxbb);
        ExcelUtil<SysTjbbLspzcxbb> util = new ExcelUtil<SysTjbbLspzcxbb>(SysTjbbLspzcxbb.class);
        util.exportExcel(response, list, "历史拍照查询数据");
    }

    /**
     * 获取历史拍照查询详细信息
     */
    @PreAuthorize("@ss.hasPermi('tjbb/dmttj:lspzcxbb:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(sysTjbbLspzcxbbService.selectSysTjbbLspzcxbbById(id));
    }

    /**
     * 新增历史拍照查询
     */
    @PreAuthorize("@ss.hasPermi('tjbb/dmttj:lspzcxbb:add')")
    @Log(title = "历史拍照查询", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody SysTjbbLspzcxbb sysTjbbLspzcxbb)
    {
        return toAjax(sysTjbbLspzcxbbService.insertSysTjbbLspzcxbb(sysTjbbLspzcxbb));
    }

    /**
     * 修改历史拍照查询
     */
    @PreAuthorize("@ss.hasPermi('tjbb/dmttj:lspzcxbb:edit')")
    @Log(title = "历史拍照查询", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody SysTjbbLspzcxbb sysTjbbLspzcxbb)
    {
        return toAjax(sysTjbbLspzcxbbService.updateSysTjbbLspzcxbb(sysTjbbLspzcxbb));
    }

    /**
     * 删除历史拍照查询
     */
    @PreAuthorize("@ss.hasPermi('tjbb/dmttj:lspzcxbb:remove')")
    @Log(title = "历史拍照查询", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(sysTjbbLspzcxbbService.deleteSysTjbbLspzcxbbByIds(ids));
    }
}
